package com.motherchild.user.controller;
import com.motherchild.admin.dto.ProductDTO;
import com.motherchild.admin.vo.CategoryVO;
import com.motherchild.admin.vo.ProductDetailVO;
import com.motherchild.common.ApiResponse;
import com.motherchild.user.service.UserProductService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

import java.io.File;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.List;
import java.util.UUID;

@RestController
@RequestMapping("/userProducts")
public class UserProductController {

    @Autowired
    private UserProductService productService;

    @GetMapping("/get")
    public ApiResponse<List<ProductDetailVO>> getList(
            @RequestParam(required = false) Integer categoryId,String keyword
           ) {
        return ApiResponse.success(productService.getList(categoryId,keyword));
    }

    @GetMapping("/getHot")
    public ApiResponse<List<ProductDetailVO>> getHot() {
        return ApiResponse.success(productService.getHot());
    }


} 